package com.eugenes.collections;

import java.util.Iterator;

public class TestClass {

    public void testAdd() {
        MyMap<Integer, Integer> map = new MyTreeMap<>();

        for (int i=0; i<20; ++i) {
            map.put(i, i+1);
        }

        map.remove(2);
        map.put(4, 4);

        for (Iterator<MyMap.Entry<Integer, Integer>> iterator = map.entryIterator();
                iterator.hasNext();) {
            MyMap.Entry<Integer, Integer> entry = iterator.next();
            System.out.println(entry.getKey() + "->" + entry.getValue());
        }
    }

    public static void main(String[] args) {
        new TestClass().testAdd();
    }
}
